<template>
  <div class="mui-numbox" data-numbox-step="1" data-numbox-min="1">
    <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
    <input class="mui-numbox-input" type="number" ref="ipt" @change="changeAmount" :value="count">
    <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
  </div>
</template>

<script>
import mui from "../../lib/mui/js/mui.min.js";

export default {
  mounted() {
    mui(".mui-numbox").numbox();
  },
  data() {
    return {
      max: this.maxCount
    };
  },
  methods: {
    changeAmount() {
      let amount = Number.parseInt(this.$refs.ipt.value);
      this.$store.commit("updateCart", { id: this.id, count: amount });
    }
  },
  watch: {},
  props: ["count", "id"]
};
</script>   


<style lang="scss" scoped>
</style>
